"""
安装pymssql模块对mssql数据库进行操作。
Catalogs are named collections of schemas, a catalog contains one or more schemas.
A catalog is often synonymous with database.
date：2020/06/28
"""
import pymssql
# database这里指定的是table_catalog而不是table_schema，这一点和mysql有点不一样。
conn = pymssql.connect(server='', user='', password='', database='')
cursor = conn.cursor()
cursor.execute('select statement')
row = cursor.fetchone()
while row:
    print(row)
    row = cursor.fetchone()